﻿@model AesApplication.Models.StoreManagerIndexViewModel

@using AesApplication.Models;

@{
    ViewBag.Title = "Job Approval";
}

<h2>@WebSecurity.CurrentUserName - New Job Posting Approval</h2>

<font color="red">
    @Html.Raw(TempData["Error"])
</font>
<form action="/StoreManager/UpdateGrid" method="post">
    <table>
        <tr>
            <td></td>
            <td>Store</td>
            <td>Department</td>
            <td>Position</td>
            <td>Quantity</td>
            <td>Start Date</td>
            <td>End Date</td>
            <td>Requester</td>
            <td>Request Date</td>
        </tr>

        @foreach (Store store in Model.Stores.ToList())
        {
            foreach (Department dept in store.Departments.ToList())
            {
                foreach (Job job in dept.Jobs.Where(x => x.Status == JobStatus.AwaitingActivation))
                {
                    <tr>
                        <td><input type="checkbox" name="AppCheckboxes" value="@job.ID" /></td>
                        <td>@store.Name</td>
                        <td>@dept.Name</td>
                        <td>@job.Title</td>
                        <td>@job.Quantity</td>
                        <td>@job.StartDate</td>
                        <td>@job.EndDate</td>
                        <td>@job.Requester</td>
                        <td>@job.RequestDate</td>
                    </tr>
                }
            }
        }
    </table>
    <br />
    <br />
    <input type="submit" name="submit" id="approve" value="approve" />
    <input type="submit" name="submit" id="deny" value="deny" />
    <input type="submit" name="submit" id="cancel" value="Cancel" />
</form>

